{% extends "base.html" %}
{% load i18n %}
{% load icons %}
{% load static %}

{% block content %}
    {% for compute in computes %}
        {% if compute.status is not True %}
            <div class="alert alert-danger alert-dismissible fade show" role="alert">
                {% trans 'Problem occurred with host' %} {{ compute.name }}: {{ compute.status }}
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
        {% endif %}
    {% endfor %}
    <div class="col-lg-12">
        {% if 'instances.view_instances' in perms %}
            {% include 'instances_index_nongrouped.html' %}
            {% comment %} {% if app_settings.VIEW_INSTANCES_LIST_STYLE == 'grouped' and request.user.is_superuser %}
                {% include 'instances_index_grouped.html' %}
            {% else %}
                {% include 'instances_index_nongrouped.html' %}
            {% endif %} {% endcomment %}
        {% endif %}
    </div>
{% endblock content %}
{% block script %}
    <script src="{% static 'assets/js/filter-table.js' %}"></script>
    {% if request.user.is_superuser %}
        <script>
            function goto_compute(compute) {
                //let compute = $("#compute_select").val();
                window.location.href = "{% url 'instances:create_instance_select_type' 1 %}".replace(1, compute);
            }
        </script>
    {% endif %}
{% endblock script %}
